<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
    <title></title>  
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="/ckadmin/static/weblib/ext/resources/css/ext-all.css" mce_href="/ckadmin/static/weblib/ext/resources/css/ext-all.css" />  
    <!--  <script type="text/javascript" src="../ext/adapter/ext/ext-base.js" mce_src="ext/adapter/ext/ext-base.js"></script>  -->
    <script src="/ckadmin/static/weblib/ext/ext-all-debug.js" mce_src="/ckadmin/static/weblib/ext/ext-all-debug.js" type="text/javascript"></script>  
  
    <style type=text/css>        .upload-icon {  
            background: url('images/image_add.png') no-repeat 0 0 !important;  
        }  
    .x-form-file-wrap {  
        position: relative;  
        height: 22px;  
    }  
    .x-form-file-wrap .x-form-file {  
        position: absolute;  
        right: 0;  
        -moz-opacity: 0;  
        filter:alpha(opacity: 0);  
        opacity: 0;  
        z-index: 2;  
        height: 22px;  
    }  
    .x-form-file-wrap .x-form-file-btn {  
        position: absolute;  
        right: 0;  
        z-index: 1;  
    }  
    .x-form-file-wrap .x-form-file-text {  
        position: absolute;  
        left: 0;  
        z-index: 3;  
        color: #777;  
    }  
    </style>  
  
    <script type="text/javascript"><!--  
        Ext.onReady(function() {  
  
            Ext.QuickTips.init();  
  
            var msg = function(title, msg) {  
                Ext.Msg.show({  
                    title: title,  
                    msg: msg,  
                    minWidth: 200,  
                    modal: true,  
                    icon: Ext.Msg.INFO,  
                    buttons: Ext.Msg.OK  
                });  
  
            };  
              
            var fp = new Ext.FormPanel({  
                renderTo: 'fi-form',  
                fileUpload: true,  
                width: 500,  
                frame: true,  
                title: '图片上传操作',  
                autoHeight: true,  
                bodyStyle: 'padding: 10px 10px 0 10px;',  
                labelWidth: 50,  
                defaults: {  
                    anchor: '95%',  
                    allowBlank: false,  
                    msgTarget: 'side'  
                },  
                items: [{  
                    xtype: 'textfield',  
                    fieldLabel: 'Name',  
                    name:"token"  
                }, {  
                    xtype: 'fileuploadfield',  
                    id: 'form-file',  
                    emptyText: 'Select an image',  
                    fieldLabel: 'Photo',  
                    name: 'photo-path',  
                    buttonText: '',  
                    buttonCfg: {  
                        iconCls: 'upload-icon'  
                    }  
}],  
                    buttons: [{  
                        text: 'Save',  
                        handler: function() {  
                            if (fp.getForm().isValid()) {  
                                fp.getForm().submit({  
                                    url: '../uploadheadimg',//后台处理的页面  
                                    waitMsg: 'Uploading your photo...',  
                                    success: function(fp, o) {  
                                        msg('Success', 'Processed file "' + o.result.files + '" on the server');  
                                    }  
                                });  
                            }  
                        }  
                    }, {  
                        text: 'Reset',  
                        handler: function() {  
                            fp.getForm().reset();  
                        }  
}]  
                    });  
                });  
      
// --></script>  
</head>  
<body>  
<div id="fi-form"></div>  
  
</body>  
</html>  